Skip to content

ci: scope whole-tree CVE scanning off the pull-request path - #136

Merged
kellenmurphy merged 1 commit into
mainfrom
ci/scope-dependency-scanning
Jun 20, 2026
Merged

ci: scope whole-tree CVE scanning off the pull-request path#136
kellenmurphy merged 1 commit into
mainfrom
ci/scope-dependency-scanning

Conversation

@kellenmurphy

Copy link
Copy Markdown
Owner

Problem

Three times running (esbuild → ws → undici), a freshly-published advisory in transitive dev/build tooling has red-X'd every open Dependabot PR at once via the npm audit and OSV gates — for advisories the PRs never touched. The build had three redundant whole-tree CVE scanners (npm audit, OSV, Grype), each able to fail independently on the same advisory, all on the PR path.

A PR check should test what the PR changes. Whole-tree security posture belongs on main + a schedule, where Dependabot's own alerts/auto-PRs already drive remediation.

Change

  • npm audit moves into a dedicated Dependency Audit job that runs on push-to-main, a weekly schedule, and manual dispatch — not on PRs. It stays the single blocking CVE gate and still gates the deploy.
  • SBOM/Grype also moves off the PR path and Grype goes non-blocking (fail-build: false) — it now contributes its independent vuln DB to the Security tab without being a second gate. Syft SBOM artifact is retained.
  • OSV Scanner job removed — redundant with npm audit. Bonus: it was the only unpinned reusable workflow, so dropping it clears the way to re-enable the “require SHA-pinned actions” repo setting (the deferred item in the security config).
  • PRs remain vuln-gated by Dependency Review (scoped to deps the diff introduces) + GuardDog (supply-chain malware). CodeQL unchanged.
  • Workflow-level permissions tightened to contents: read (the actions: read / workflow-level security-events: write existed only for the OSV reusable-workflow call).

SECURITY.md is updated throughout to match.

⚠️ Required follow-up before this can merge

Branch-protection required status checks must drop OSV Scanner / osv-scan and SBOM & Grype Scan — both no longer run on PRs, so leaving them required would block all future PRs (and this one). New required set: Build & Test, GuardDog Supply Chain Scan, Dependency Review, CodeQL.

Net effect

Deploy-time protection is identical; a vuln a PR introduces still blocks that PR; but a new advisory in unrelated dev tooling no longer breaks every open PR — it surfaces via Dependabot + the push/scheduled scan instead.

The npm audit and OSV gates were failing every open PR whenever a new
transitive advisory dropped in dev/build tooling (esbuild, ws, undici in
quick succession) — advisories the PRs never touched. A PR check should
test what the PR changes; whole-tree security posture belongs on main.

- Move npm audit into a dedicated Dependency Audit job that runs on
  push-to-main, a weekly schedule, and manual dispatch — not on PRs.
- Take SBOM/Grype off the PR path too and make Grype non-blocking
  (fail-build: false); npm audit is the single blocking CVE gate.
- Remove the redundant OSV Scanner job. This also drops the only
  unpinned reusable workflow, clearing the way to re-enable the
  'require SHA-pinned actions' repo setting.
- PRs remain vuln-gated by Dependency Review (diff-scoped) + GuardDog;
  Dependabot alerts/auto-PRs drive remediation; push-to-main still
  gates deploy, so production protection is unchanged.
- Tighten workflow-level permissions to contents:read (actions:read and
  workflow-level security-events:write existed only for the OSV call).

Branch-protection required checks must drop 'OSV Scanner / osv-scan' and
'SBOM & Grype Scan' (they no longer run on PRs); SECURITY.md updated to
match.
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kellenmurphy
kellenmurphy merged commit 304cbd8 into main Jun 20, 2026
10 checks passed
@kellenmurphy
kellenmurphy deleted the ci/scope-dependency-scanning branch June 20, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant